package com.interview02;

import java.util.Scanner;
import java.util.Stack;

public class buerbiaodashi {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String line = scanner.nextLine();
		String[] splits = line.split(" ");
		if(splits[splits.length-1].equals("and")||splits[splits.length-1].equals("or")) {
			System.out.println("error");
			return;
		}
		Stack<String> stack = new Stack<String>();
		for(int i=0;i<splits.length;i++) {
			String temp = splits[i];
			if(i%2==0&&(temp.equals("or")||temp.equals("and"))){
				System.out.println("error");
				return;
			}else if(i%2==1&&(temp.equals("true")||temp.equals("false"))) {
				System.out.println("error");
				return;
			}else {
				if(temp.equals("and")) {
					temp = stack.pop();
					temp = temp.equals("false")||splits[i+1].equals("false")?"false":"true";
					stack.push(temp);
					i++;
				}else {
					stack.push(temp);
				}
			}
		}
		
		while(!stack.isEmpty()) {
			String istrue = stack.pop();
				if(istrue.equals("true")) {
					System.out.println("true");
					return;
				}
			}
		System.out.println("false");
		return;
		}
			
	}

